﻿var Storage = "queue.core.windows.net";
var AccountName;
var SharedKey;
var YellowAlert;
var RedAlert;
var PollTime;
var QueueName;

//retrieve settings or set default
function GetSettings() {
    //set defaults
    AccountName = "";
    SharedKey = "";
    QueueName = "";
    YellowAlert = 200;
    RedAlert = 1000;
    PollTime = 300;
    
    if (System.Gadget.Settings.read("SavedSetting") != "") {
        //load settings
        AccountName = System.Gadget.Settings.read("AccountName");
        SharedKey = System.Gadget.Settings.read("SharedKey");
        YellowAlert = System.Gadget.Settings.read("YellowAlert");
        RedAlert = System.Gadget.Settings.read("RedAlert");
        PollTime = System.Gadget.Settings.read("PollTime");
        QueueName = System.Gadget.Settings.read("QueueName");
    }
}